<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/style.css" />
		<script type="text/javascript" src="../js/jquery-1.8.0.min.js" ></script>
		<script type="text/javascript" src="../js/head_public.js" ></script>
		<style>
			input{font-size: 14px!important;width: 74%!important;}
			.baocun{color: #fff;border: 1px solid #fff;background: #ff7e00;position: absolute;z-index: 10;top: 0.12rem;right: 0.2rem;}
		    .xinbie{width: 95%;margin: auto;overflow: hidden;color: #666;}
		    .radio-div img{display: inline-block;width: 0.4rem;}
            .radio-div{padding: 0.3rem 0px;}
            .imgbtn{display: block;float: left;width: 30%;margin-right: 1.5%;}
            .queren-btn-lists button{
            	color: #fff;width: 70px;border: none;
            }
            .queren-btn-lists button:nth-of-type(1){margin-right: 20px;
            	background: #ff7e00;
            }
            .queren-btn-lists button:nth-of-type(2){
            	background: #31a5ef;
            }
            .queren-btn-lists {margin-top: 50px;}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav ding-bar">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">确认工单</h1>
		</header>
		<div class="mui-content" >
		    <form class="changep-form">
		    	<div style="background: #fff;">
		    		<p style="border: none;">
		    			<span>电梯编号：</span>
			    		<input type="text" readonly="readonly" id="dtbh" />
			    	</p>
		    	</div>
		    	<div style="background: #fff;">
		    		<p style="border: none;">
		    			<span>维保单号：</span>
			    		<input type="text" readonly="readonly"id="wbdh" />
			    	</p>
		    	</div>
		    	<!--<div class="kong" ></div>
		    	<div style="background: #fff;">
		    		<p style="border: none;background: #fff;">
			    		<span style="width: 100%;padding-top: 3px;font-size: 0.35rem;">电梯位置</span>
			    		<textarea placeholder="请输入电梯位置" style="display: block;border: none;font-size: 0.35rem;width: 100%;"></textarea>
			    	</p>
		    	</div>-->
		    	<div class="kong" ></div>
		    	<div style="background: #fff;">
		    		<p style="border: none;background: #fff;">
			    		<span style="width: 100%;padding-top: 3px;font-size: 0.35rem;">驳回原因：</span>
			    		<textarea readonly="readonly" id="reause" style="display: block;border: none;font-size: 0.35rem;width: 100%;"></textarea>
			    	</p>
		    	</div>
		    	<!--<div class="kong"></div>-->
		    	<!--<div style="background: #efeff4;padding: 2px 0px;text-align: center;" class="queren-btn-lists">
		        	 <button class="qr-finish" type="button" style="font-weight: bold;letter-spacing: 2px;">确认</button>
		        	 <button class="bohui" type="button" style="font-weight: bold;letter-spacing: 2px;">驳回</button>
		        </div>-->
		    </form>
		</div>
		<script src="../js/mui.min.js"></script>
		<script src="../js/common.js"></script>
		<script src="../js/session.js"></script>
		<script type="text/javascript">
		mui.init()
//  	判断登录与否
        var userid=getCookie("userid")
        var work=getCookie("work")
        var work_id=getCookie("workid")      	
		if(userid==null||userid==""){
			alert("您还没有登录，请登录")
			mui.openWindow({url:"login.html"})
		}else{
		    if(work!="1"){
				alert("您不是管理员,您没有权限")
				mui.openWindow({url:"../public/index.html"})
			}
		}
	
		
		var id=getQueryString("id");
		if(id==""||id==null){
			alert("网络错误！")
			location.href="daiqueren.html";
		}
		//获取维保单号
		$.post(net+"/public/index.php?s=api/elevator/manage_bug_check",{"member_id":userid,"id":id},function(res){
			if(res.code=="200"){
				$("#dtbh").val(res.result.code)
				$("#wbdh").val(res.result.number)
			}
		})
		//获取驳回原因
		$.post(net+"/public/index.php?s=api/elevator/serviceBug_info",{"member_id":userid,"id":id},function(res){
			if(res.code=="200"){
				$("#reause").val(res.result.check_reason)
			}
		})
		mui(".changep-form").on("tap","button",function(){
	
			var check="";
			var data={};
			if($(this).hasClass("bohui")){
				check="-1";
			}else if($(this).hasClass("qr-finish")){
				check="2";
			}
			if(check!=null&&check!=""){
				data.check=check;
			}else{
				return false;
			}
			var check_reason=$("#reause").val();
			if(check_reason==""||check_reason==null){
				alert("确认情况与驳回原因不能为空！");
				return false;
			}
			data.member_id=userid;
			data.id=id;
			data.check_reason=check_reason;
			$.post(net+"/public/index.php?s=api/elevator/manage_bugcheck_action",data,function(res){
				if(res.code=="200"){
					alert("提交成功！")
					location.href="daiqueren.html";
				}
			})
			
		})
		
          
		</script>
	</body>

</html>